package com.dh.blog.handler.parser;


import javax.xml.xpath.XPathExpressionException;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
 * xml解析接口
 * @author David
 *
 */
public interface Parser {
	/**
	 * 解析字符串
	 * @param expr
	 * @param obj
	 * @return
	 * @throws XPathExpressionException 
	 */
	public String evalString(String expr,Object obj) throws Exception;
	/**
	 * 解析boolean
	 * @param expr
	 * @param obj
	 * @return
	 */
	public Boolean evalBoolean(String expr,Object obj) throws Exception;
	/**
	 * 解析数字(Double)
	 * @param expr
	 * @param obj
	 * @return
	 */
	public Double evalNum(String expr,Object obj) throws Exception;
	/**
	 * 解析org.w3c.dom.Node结点
	 * @param expr
	 * @param obj
	 * @return
	 */
	public Node evalNode(String expr,Object obj) throws Exception;
	/**
	 * 解析org.w3c.dom.NodeList结点
	 * @param expr
	 * @param obj
	 * @return
	 */
	public NodeList evalNodeList(String expr,Object obj) throws Exception;
	/**
	 * 解析根节点
	 * @param obj
	 * @return
	 */
	public Node evalRoot(Object obj) throws Exception;
}
